import numpy as np

np.random.seed(1)

M = 40
x1_v = np.concatenate([
    np.random.normal(100, 20, M),
    np.random.normal(200, 20, M)
])
x2_v = np.concatenate([
    np.random.normal(150, 20, M),
    np.random.normal(72, 20, M)
])
x3_v = np.concatenate([
    np.random.normal(-50, 20, M),
    np.random.normal(200, 20, M)
])
y_v = np.concatenate([
    np.full(M, 1, dtype=np.int0),
    np.full(M, 0, dtype=np.int0),
])

rnd_idx = np.random.permutation(2 * M)
x1_v = x1_v[rnd_idx]
x2_v = x2_v[rnd_idx]
x3_v = x3_v[rnd_idx]
y_v = y_v[rnd_idx]

X = np.concatenate([x1_v.reshape(-1, 1), x2_v.reshape(-1, 1), x3_v.reshape(-1, 1)], axis=1)
Y = y_v.reshape(-1, 1)

if '__main__' == __name__:
    from mpl_toolkits import mplot3d
    import matplotlib.pyplot as plt

    fig = plt.figure(figsize=[6, 6])
    ax = plt.axes(projection='3d')

    ax.scatter3D(x1_v[y_v > 0.5], x2_v[y_v > 0.5], x3_v[y_v > 0.5], color='red')
    ax.scatter3D(x1_v[y_v < 0.5], x2_v[y_v < 0.5], x3_v[y_v < 0.5], color='blue')

    plt.show()
